var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2UIManager = require("UIManager");
var $2Platformconf = require("Platformconf");
var $2ccUtil = require("ccUtil");
var $2UIAddDesk = require("UIAddDesk");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_Desktop = /* */function (_cc$Component12) {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
    return _callSuper(this, _ctor, arguments);
  }
  babel_inherits(_ctor, _cc$Component12);
  return babel_createClass(_ctor, [{
    key: "onEnable",
    value: function onEnable() {
      if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame) {
        var _e15 = window.tt.getSystemInfoSync();
        var _t6 = _e15.version;
        if ("Douyin" == _e15.appName || "douyin_lite" == _e15.appName) {
          console.log("platform:", _e15.platform);
          var _n4 = "2.46.0";
          if ($2ccUtil.default.compareVersions(_t6, _n4) < 0) {
            this.node.active = false;
          } else {
            this.node.active = true;
          }
        } else {
          this.node.active = false;
        }
      }
    }
  }, {
    key: "onClickDesktop",
    value: function onClickDesktop() {
      if ($2Platformconf.default.PlatformType == $2Platformconf.ePlatformType.TTGame) {
        var _e16 = false;
        var _t7 = window.tt.getLaunchOptionsSync();
        console.log("加桌功能测试当前场景值：", _t7, _t7.scene, _t7.desktop);
        if (1036 === _t7.scene) {
          console.log("用户是从桌面图标进入的");
          _e16 = true;
        } else {
          _e16 = false;
        }
        $2UIManager.UIManager.getInstance().showUI($2UIAddDesk.default, function (t) {
          t && t.setData(_e16);
        });
      }
    }
  }]);
}(cc.Component);
def_Desktop = cc__decorate([ccp_ccclass], def_Desktop);
exports.default = def_Desktop;